using System.Collections;
using System.Collections.Generic;
using Assets.Scripts;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;

public class ShopTips : UIBase
{
    public static ShopTips ins;
    //public Button But_Add, But_Remove;
    //float Num;
    public Image icon, Tips;
    public Text Name,Destext;
    private RectTransform rectTransform;
    private Canvas canvas;

    void Awake()
    {
        ins = this;
    }

    public void SetData(ShopData data)
    {
        if (data != null)
        {
            icon.sprite = Resources.Load<Sprite>(data.icon);
            Name.text = data.name;
            Destext.text = data.Des;
            //Num = 0;
        }
        
      
    }
    // Start is called before the first frame update
    void Start()
    {
        // But_Add.onClick.AddListener(() =>
        // {
        //     NumText.text = (Num += 1).ToString();
        // });
        // But_Remove.onClick.AddListener(() =>
        // {
        //     NumText.text = (Num -= 1).ToString();
        // });
        rectTransform = transform as RectTransform;
        canvas = GetComponentInParent<Canvas>();
    }

    // Update is called once per frame
    void Update()
    {
      //NumText.text=  Num.ToString();
        // Vector2 localPoint;
        //RectTransformUtility.ScreenPointToLocalPointInRectangle(canvas.transform as RectTransform, Input.mousePosition, canvas.worldCamera, out localPoint);
        //rectTransform.anchoredPosition = localPoint;
    }
}
